home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / MacOSMediaPartitionMap.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  4KB  |  121 lines

  1. /*
  2.      File:        MacOSMediaPartitionMap.h
  3.  
  4.      Contains:    MacOS Partition Map Format definitions
  5.  
  6.      Version:    Technology:    Copland
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __MACOSMEDIAPARTITIONMAP__
  19. #define __MACOSMEDIAPARTITIONMAP__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #if PRAGMA_IMPORT_SUPPORTED
  30. #pragma import on
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if FOR_SYSTEM8_PREEMPTIVE
  38. /*
  39.  * Prior to System 8 these structures are defined in SCSI.h
  40. */
  41. /* Signatures */
  42.  
  43. enum {
  44.     sbSIGWord                    = 0x4552,                        /* signature word for Block 0 ('ER') */
  45.     sbMac                        = 1,                            /* system type for Mac */
  46.     pMapSIG                        = 0x504D,                        /* partition map signature ('PM') */
  47.     pdSigWord                    = 0x5453
  48. };
  49.  
  50.  
  51. enum {
  52.     oldPMSigWord                = pdSigWord,
  53.     newPMSigWord                = pMapSIG
  54. };
  55.  
  56. /* Driver Descriptor Map */
  57. struct Block0 {
  58.     unsigned short                     sbSig;                        /* unique value for SCSI block 0 */
  59.     unsigned short                     sbBlkSize;                    /* block size of device */
  60.     unsigned long                     sbBlkCount;                    /* number of blocks on device */
  61.     unsigned short                     sbDevType;                    /* device type */
  62.     unsigned short                     sbDevId;                    /* device id */
  63.     unsigned long                     sbData;                        /* not used */
  64.     unsigned short                     sbDrvrCount;                /* driver descriptor count */
  65.     unsigned long                     ddBlock;                    /* 1st driver's starting block */
  66.     unsigned short                     ddSize;                        /* size of 1st driver (512-byte blks) */
  67.     unsigned short                     ddType;                        /* system type (1 for Mac+) */
  68.     unsigned short                     ddPad[243];                    /* ARRAY[0..242] OF INTEGER; not used */
  69. };
  70. typedef struct Block0 Block0;
  71.  
  72. /*Driver descriptor*/
  73. struct DDMap {
  74.     unsigned long                     ddBlock;                    /* 1st driver's starting block */
  75.     unsigned short                     ddSize;                        /* size of 1st driver (512-byte blks) */
  76.     unsigned short                     ddType;                        /* system type (1 for Mac+) */
  77. };
  78. typedef struct DDMap DDMap;
  79.  
  80. /* Partition Map Entry */
  81. /* packed in ".i"*/
  82. struct Partition {
  83.     unsigned short                     pmSig;                        /* unique value for map entry blk */
  84.     unsigned short                     pmSigPad;                    /* currently unused */
  85.     unsigned long                     pmMapBlkCnt;                /* # of blks in partition map */
  86.     unsigned long                     pmPyPartStart;                /* physical start blk of partition */
  87.     unsigned long                     pmPartBlkCnt;                /* # of blks in this partition */
  88.     unsigned char                     pmPartName[32];                /* ASCII partition name */
  89.     unsigned char                     pmParType[32];                /* ASCII partition type */
  90.     unsigned long                     pmLgDataStart;                /* log. # of partition's 1st data blk */
  91.     unsigned long                     pmDataCnt;                    /* # of blks in partition's data area */
  92.     unsigned long                     pmPartStatus;                /* bit field for partition status */
  93.     unsigned long                     pmLgBootStart;                /* log. blk of partition's boot code */
  94.     unsigned long                     pmBootSize;                    /* number of bytes in boot code */
  95.     unsigned long                     pmBootAddr;                    /* memory load address of boot code */
  96.     unsigned long                     pmBootAddr2;                /* currently unused */
  97.     unsigned long                     pmBootEntry;                /* entry point of boot code */
  98.     unsigned long                     pmBootEntry2;                /* currently unused */
  99.     unsigned long                     pmBootCksum;                /* checksum of boot code */
  100.     unsigned char                     pmProcessor[16];            /* ASCII for the processor type */
  101.     unsigned short                     pmPad[188];                    /* ARRAY[0..187] OF INTEGER; not used */
  102. };
  103. typedef struct Partition Partition;
  104.  
  105. #endif
  106.  
  107. #if PRAGMA_ALIGN_SUPPORTED
  108. #pragma options align=reset
  109. #endif
  110.  
  111. #if PRAGMA_IMPORT_SUPPORTED
  112. #pragma import off
  113. #endif
  114.  
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118.  
  119. #endif /* __MACOSMEDIAPARTITIONMAP__ */
  120.  
  121.